/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *  
Links industries used in the IFR reports to the 1990 industry classification used in the Census
Before running it, the variable ind1990 must be in the dataset.
3.30.2018
Pascual Restrepo Mesa
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

gen industry_ifr19=""

/*1. Agriculture*/
replace industry_ifr="agriculture" if ind1990==10
replace industry_ifr="agriculture" if ind1990==11
replace industry_ifr="agriculture" if ind1990==12
replace industry_ifr="agriculture" if ind1990==20
replace industry_ifr="agriculture" if ind1990==30
replace industry_ifr="agriculture" if ind1990==31
replace industry_ifr="agriculture" if ind1990==32
replace industry_ifr="agriculture" if ind1990==230 /*Logging*/

/*2. Mining*/
replace industry_ifr="mining" if ind1990==40
replace industry_ifr="mining" if ind1990==41
replace industry_ifr="mining" if ind1990==42
replace industry_ifr="mining" if ind1990==50

/*3. Food and Beveradges (manufacture)*/
replace industry_ifr="food" if ind1990==100
replace industry_ifr="food" if ind1990==101
replace industry_ifr="food" if ind1990==102
replace industry_ifr="food" if ind1990==110
replace industry_ifr="food" if ind1990==111
replace industry_ifr="food" if ind1990==112
replace industry_ifr="food" if ind1990==120
replace industry_ifr="food" if ind1990==121
replace industry_ifr="food" if ind1990==122
replace industry_ifr="food" if ind1990==130

/*4. Textiles (manufacture) */
*textile mills*
replace industry_ifr="textiles" if ind1990==132
replace industry_ifr="textiles" if ind1990==140
replace industry_ifr="textiles" if ind1990==141
replace industry_ifr="textiles" if ind1990==142
replace industry_ifr="textiles" if ind1990==150
replace industry_ifr="textiles" if ind1990==151
replace industry_ifr="textiles" if ind1990==152
*leather products*
replace industry_ifr="textiles" if ind1990==220
replace industry_ifr="textiles" if ind1990==221
replace industry_ifr="textiles" if ind1990==222

/*5. Wood and Furniture (manufacture)*/
replace industry_ifr="furniture" if ind1990==231
replace industry_ifr="furniture" if ind1990==232
replace industry_ifr="furniture" if ind1990==241
replace industry_ifr="furniture" if ind1990==242

/*6. Paper (manufacture)*/
replace industry_ifr="paper" if ind1990==160
replace industry_ifr="paper" if ind1990==161
replace industry_ifr="paper" if ind1990==162
replace industry_ifr="paper" if ind1990==171
replace industry_ifr="paper" if ind1990==172 

/*7. Plastic, pharmaceuticals and chemicals (manufacture)*/
*plastic*
replace industry_ifr="petrochemicals" if ind1990==180
*pharmaceuticals*
replace industry_ifr="petrochemicals" if ind1990==181
replace industry_ifr="petrochemicals" if ind1990==182
*chemicals*
replace industry_ifr="petrochemicals" if ind1990==190
replace industry_ifr="petrochemicals" if ind1990==191
replace industry_ifr="petrochemicals" if ind1990==192
*petroleum and coal products*
replace industry_ifr="petrochemicals" if ind1990==200
replace industry_ifr="petrochemicals" if ind1990==201
*rubber*
replace industry_ifr="petrochemicals" if ind1990==210 
replace industry_ifr="petrochemicals" if ind1990==211
replace industry_ifr="petrochemicals" if ind1990==212


/*8. Glass, ceramics, mineral products (manufacture)*/
replace industry_ifr="mineral" if ind1990==250
replace industry_ifr="mineral" if ind1990==251
replace industry_ifr="mineral" if ind1990==252
replace industry_ifr="mineral" if ind1990==261
replace industry_ifr="mineral" if ind1990==262

/*9. Basic metals (manufacture)*/
replace industry_ifr="metal_basic" if ind1990==270
replace industry_ifr="metal_basic" if ind1990==271
replace industry_ifr="metal_basic" if ind1990==272
replace industry_ifr="metal_basic" if ind1990==280
replace industry_ifr="metal_basic" if ind1990==301 /*Unclassified metals*/

/*11. Metal products (manufacture)*/
replace industry_ifr="metal_products" if ind1990==281
replace industry_ifr="metal_products" if ind1990==282
replace industry_ifr="metal_products" if ind1990==290
replace industry_ifr="metal_products" if ind1990==291
replace industry_ifr="metal_products" if ind1990==292
replace industry_ifr="metal_products" if ind1990==300

/*10. Industrial machinery (manufacture)*/
replace industry_ifr="metal_machinery" if ind1990==310
replace industry_ifr="metal_machinery" if ind1990==311
replace industry_ifr="metal_machinery" if ind1990==312
replace industry_ifr="metal_machinery" if ind1990==320
replace industry_ifr="metal_machinery" if ind1990==331
replace industry_ifr="metal_machinery" if ind1990==332

/*12. Electronics (manufacture)*/
*computers*
replace industry_ifr="electronics" if ind1990==321
replace industry_ifr="electronics" if ind1990==322
*household electronics*
replace industry_ifr="electronics" if ind1990==340
*communication equipment*
replace industry_ifr="electronics" if ind1990==341
replace industry_ifr="electronics" if ind1990==342     /*Miscellaneous electronics---contains SIC87 3641, 3643, 3644, 3645, 3646, 3647, 3648 which are all about electronics*/
replace industry_ifr="electronics" if ind1990==350     /*Corrected on 3.5.2019. R&J2018 assigned this industry to "Machinery"*/
*medical/optical/precision instruments*
replace industry_ifr="electronics" if ind1990==371
replace industry_ifr="electronics" if ind1990==372
replace industry_ifr="electronics" if ind1990==380
replace industry_ifr="electronics" if ind1990==381

/*13. Automotive (manufacture)*/
replace industry_ifr="automotive" if ind1990==351

/*14. Other vehicles (manufacture)*/
replace industry_ifr="vehicles_other" if ind1990==352
replace industry_ifr="vehicles_other" if ind1990==360
replace industry_ifr="vehicles_other" if ind1990==361
replace industry_ifr="vehicles_other" if ind1990==362
replace industry_ifr="vehicles_other" if ind1990==370

/*15. Other manufacturing industries (toys and miscellaneous industries)*/
*toys
replace industry_ifr="manufacturing_other" if ind1990==390
*miscellaneous
replace industry_ifr="manufacturing_other" if ind1990==391
replace industry_ifr="manufacturing_other" if ind1990==392

/*16. Utilities (electricity, gas, water supply)*/
replace industry_ifr="utilities" if ind1990==450
replace industry_ifr="utilities" if ind1990==451
replace industry_ifr="utilities" if ind1990==452
replace industry_ifr="utilities" if ind1990==470
replace industry_ifr="utilities" if ind1990==471
replace industry_ifr="utilities" if ind1990==472

/*17. Constructions*/
replace industry_ifr="construction" if ind1990==60

/*18. Education and research*/
replace industry_ifr="research" if ind1990==850
replace industry_ifr="research" if ind1990==851
replace industry_ifr="research" if ind1990==852
replace industry_ifr="research" if ind1990==860
replace industry_ifr="research" if ind1990==891

/*19. Other nonmanufacturing industries*/
replace industry_ifr="services" if ind1990==400
replace industry_ifr="services" if ind1990==401
replace industry_ifr="services" if ind1990==402
replace industry_ifr="services" if ind1990==410
replace industry_ifr="services" if ind1990==411
replace industry_ifr="services" if ind1990==412
replace industry_ifr="services" if ind1990==420
replace industry_ifr="services" if ind1990==421
replace industry_ifr="services" if ind1990==422
replace industry_ifr="services" if ind1990==432
replace industry_ifr="services" if ind1990==440
replace industry_ifr="services" if ind1990==441
replace industry_ifr="services" if ind1990==442
replace industry_ifr="services" if ind1990==500
replace industry_ifr="services" if ind1990==501
replace industry_ifr="services" if ind1990==502
replace industry_ifr="services" if ind1990==510
replace industry_ifr="services" if ind1990==511
replace industry_ifr="services" if ind1990==512
replace industry_ifr="services" if ind1990==521
replace industry_ifr="services" if ind1990==530
replace industry_ifr="services" if ind1990==531
replace industry_ifr="services" if ind1990==532
replace industry_ifr="services" if ind1990==540
replace industry_ifr="services" if ind1990==541
replace industry_ifr="services" if ind1990==542
replace industry_ifr="services" if ind1990==550
replace industry_ifr="services" if ind1990==551
replace industry_ifr="services" if ind1990==552
replace industry_ifr="services" if ind1990==560
replace industry_ifr="services" if ind1990==561
replace industry_ifr="services" if ind1990==562
replace industry_ifr="services" if ind1990==571
replace industry_ifr="services" if ind1990==580
replace industry_ifr="services" if ind1990==581
replace industry_ifr="services" if ind1990==582
replace industry_ifr="services" if ind1990==590
replace industry_ifr="services" if ind1990==591
replace industry_ifr="services" if ind1990==592
replace industry_ifr="services" if ind1990==600
replace industry_ifr="services" if ind1990==601
replace industry_ifr="services" if ind1990==602
replace industry_ifr="services" if ind1990==610
replace industry_ifr="services" if ind1990==611
replace industry_ifr="services" if ind1990==612
replace industry_ifr="services" if ind1990==620
replace industry_ifr="services" if ind1990==621
replace industry_ifr="services" if ind1990==622
replace industry_ifr="services" if ind1990==623
replace industry_ifr="services" if ind1990==630
replace industry_ifr="services" if ind1990==631
replace industry_ifr="services" if ind1990==632
replace industry_ifr="services" if ind1990==633
replace industry_ifr="services" if ind1990==640
replace industry_ifr="services" if ind1990==641
replace industry_ifr="services" if ind1990==642
replace industry_ifr="services" if ind1990==650
replace industry_ifr="services" if ind1990==651
replace industry_ifr="services" if ind1990==652
replace industry_ifr="services" if ind1990==660
replace industry_ifr="services" if ind1990==661
replace industry_ifr="services" if ind1990==662
replace industry_ifr="services" if ind1990==663
replace industry_ifr="services" if ind1990==670
replace industry_ifr="services" if ind1990==671
replace industry_ifr="services" if ind1990==672
replace industry_ifr="services" if ind1990==681
replace industry_ifr="services" if ind1990==682
replace industry_ifr="services" if ind1990==691
replace industry_ifr="services" if ind1990==700
replace industry_ifr="services" if ind1990==701
replace industry_ifr="services" if ind1990==702
replace industry_ifr="services" if ind1990==710
replace industry_ifr="services" if ind1990==711
replace industry_ifr="services" if ind1990==712
replace industry_ifr="services" if ind1990==721
replace industry_ifr="services" if ind1990==722
replace industry_ifr="services" if ind1990==731
replace industry_ifr="services" if ind1990==732
replace industry_ifr="services" if ind1990==740
replace industry_ifr="services" if ind1990==741
replace industry_ifr="services" if ind1990==742
replace industry_ifr="services" if ind1990==750
replace industry_ifr="services" if ind1990==751
replace industry_ifr="services" if ind1990==752
replace industry_ifr="services" if ind1990==760
replace industry_ifr="services" if ind1990==761
replace industry_ifr="services" if ind1990==762
replace industry_ifr="services" if ind1990==770
replace industry_ifr="services" if ind1990==771
replace industry_ifr="services" if ind1990==772
replace industry_ifr="services" if ind1990==780
replace industry_ifr="services" if ind1990==781
replace industry_ifr="services" if ind1990==782
replace industry_ifr="services" if ind1990==790
replace industry_ifr="services" if ind1990==791
replace industry_ifr="services" if ind1990==800
replace industry_ifr="services" if ind1990==801
replace industry_ifr="services" if ind1990==802
replace industry_ifr="services" if ind1990==810
replace industry_ifr="services" if ind1990==812
replace industry_ifr="services" if ind1990==820
replace industry_ifr="services" if ind1990==821
replace industry_ifr="services" if ind1990==822
replace industry_ifr="services" if ind1990==830
replace industry_ifr="services" if ind1990==831
replace industry_ifr="services" if ind1990==832
replace industry_ifr="services" if ind1990==840
replace industry_ifr="services" if ind1990==841
replace industry_ifr="services" if ind1990==862
replace industry_ifr="services" if ind1990==863
replace industry_ifr="services" if ind1990==870
replace industry_ifr="services" if ind1990==871
replace industry_ifr="services" if ind1990==872
replace industry_ifr="services" if ind1990==873
replace industry_ifr="services" if ind1990==880
replace industry_ifr="services" if ind1990==881
replace industry_ifr="services" if ind1990==890
replace industry_ifr="services" if ind1990==892
replace industry_ifr="services" if ind1990==893
replace industry_ifr="services" if ind1990==900
replace industry_ifr="services" if ind1990==901
replace industry_ifr="services" if ind1990==910
replace industry_ifr="services" if ind1990==921
replace industry_ifr="services" if ind1990==922
replace industry_ifr="services" if ind1990==930
replace industry_ifr="services" if ind1990==931
replace industry_ifr="services" if ind1990==932
*fixed on 6.12.2018*
replace industry_ifr="services" if ind1990==882
replace industry_ifr="services" if ind1990==842
replace industry_ifr="services" if ind1990==861

